package com.codi.bus.core.dao.impl;

import com.codi.base.dao.v2.GeneratedBaseDaoImpl;
import com.codi.bus.core.dao.FundDividentsDao;
import com.codi.bus.core.domain.FundDividents;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository("fundDividentsDao")
public class FundDividentsDaoImpl extends GeneratedBaseDaoImpl<FundDividents> implements FundDividentsDao {

    @Override
    public List<FundDividents> selectByClientIdAndAffirmDate(String clientId,String affirmDate) {
        Map<String, Object> map = new HashMap<>();
        map.put("clientId",clientId);
        map.put("affirmDate",affirmDate);
        return this.findList(this.generateStatement("selectByClientIdAndAffirmDate"),map);
    }

    @Override
    public List<FundDividents> selectDividend(Integer userId, String clientId, String tradeAcco, String fundCode) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId",userId);
        map.put("clientId",clientId);
        map.put("tradeAcco",tradeAcco);
        map.put("fundCode",fundCode);
        return this.findList(this.generateStatement("selectDividend"),map);
    }

    @Override
    public List<FundDividents> selectAllByAffirmDate(String affirmDate) {
        return this.findList(this.generateStatement("selectAllByAffirmDate"),affirmDate);
    }
}
